package com.itttq.sc.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.itttq.sc.po.RiverPo;
@Mapper
public interface IRiverMapper {
	@Select("select * from river_info where id=#{id}")
    public RiverPo findRiver(@Param("id") int id);
	
	@Insert("INSERT INTO USER(name, type, code, parent_id, order, direction, attribute, entrance, pass, remark)"
			+ " VALUES(#{name}, #{type},#{code}, #{parentId},#{order}, #{direction},#{attribute}, #{entrance}, #{pass}, #{remark})")
	int insertRiver(RiverPo river);

    @Select("select * from river_info where name like '%#{name}%' and code=#{code}")
    public List<RiverPo> findRivers(RiverPo river);
    
    @Delete("delete from river_info where id = #{0}")
    public void deleteRiver(int id);
  
    @Update(" update river_info set name = #{name},code= #{code},order = #{order}  where id = #{id}  ")  
    public void updateRiver(RiverPo river);  

}
